package com.kly.smartbi.model.enums;

import lombok.Getter;

/**
 * @author admin
 * @date 2025/3/30
 */
@Getter
public enum ChatSendTypeEnum {

    USER("用户", 0),
    SYSTEM("系统", 1);
    private final String text;
    private final Integer value;

    ChatSendTypeEnum(String text, Integer value) {
        this.text = text;
        this.value = value;
    }

    /**
     * 根据 value 获取枚举
     * @param value
     * @return
     */
    public static ChatSendTypeEnum getEnumByValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (ChatSendTypeEnum anEnum : ChatSendTypeEnum.values()) {
            if (anEnum.value.equals(value)) {
                return anEnum;
            }
        }
        return null;
    }
}
